package HttpBean.Response;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class ResponseHeader implements Cloneable{
    private Map<String,String> map;

    public ResponseHeader() {
        this.map = new HashMap<>();
    }

    public void set(String key,String value){
        this.map.put(key,value);
    }
    public String[] getHeader(){
        Iterator iterator = map.entrySet().iterator();
        String[] strings = new String[map.size()];
        int opt = 0;
        while (iterator.hasNext()){
            Map.Entry entry = (Map.Entry) iterator.next();
            strings[opt] = entry.getKey()+":"+entry.getValue();
            opt++;
        }
        return strings;
    }
}
